//
// Created by Zhangwj on 2023/9/26.
//

#ifndef COMPILE_TASK2_CONSTDEFNODE_H
#define COMPILE_TASK2_CONSTDEFNODE_H


#include "SyntaxTreeNode.h"
#include "../Parser.h"
#include "ConstExpNode.h"
#include "ConstInitValNode.h"

class ConstDefNode : SyntaxTreeNode {
public:
    //ConstDef → Ident { '[' ConstExp ']' } '=' ConstInitVal
    std::unique_ptr<IdentNode> Ident;
    std::vector<std::unique_ptr<ConstExpNode>> ConstExps;
    std::unique_ptr<ConstInitValNode> ConstInitVal;

    static std::unique_ptr<ConstDefNode> ConstDefParser(Parser &parser);
};


#endif //COMPILE_TASK2_CONSTDEFNODE_H
